#include "LoopPlayer.h"

namespace LTGame
{

	void LoopPlayer::updateActionSquenceController()
	{
		Animation* anim = getAnimation();
		if ( anim == NULL )	return;
		m_asc[ASC_FRAME_DELAY]++;
		if (m_asc[ASC_FRAME_DELAY] <
			( (anim->getAnimationData()-> sequenceDatas[anim->getAnimationData()-> actionSequenceOffset[m_actionID] + (m_asc[ASC_SQUENCE_INDEX] << 1)] >>
			MOVE_BIT_DURATION) & MASK_DURATION)) {
				return;
		}
		m_asc[ASC_FRAME_DELAY] = 0;
		++m_asc[ASC_SQUENCE_INDEX];
		if (m_asc[ASC_SQUENCE_INDEX] < anim->getAnimationData()-> actionSequenceCounts[m_actionID]) {
			return;
		}
		setAnimPlayerFlag(FLAG_ACTION_OVER);
		m_asc[ASC_SQUENCE_INDEX] = 0;
	}
}